home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / JForth / Extras / SysGen / AJF_DICT < prev    next >
Encoding:
Text File  |  1988-04-23  |  1.2 KB  |  55 lines

  1. \ Host Dependant Dictionary support.
  2. \
  3. \ Author: Phil Burk
  4. \ Copyright 1986 Delta Research 
  5. \
  6. ANEW TASK-AJF_DICT
  7.  
  8. \ Select HOST by setting appropriate constant to true.
  9. TRUE constant #HOST_AMIGA_JFORTH
  10. FALSE constant #HOST_MAC_MACH2
  11.  
  12. #HOST_AMIGA_JFORTH .IF
  13.     FALSE constant #FORTH_F79
  14.     FALSE constant #FORTH_FIG
  15.     TRUE  constant #FORTH-F83
  16. .THEN 
  17.  
  18. : 'C  ( <WORD> -- CFA , Gets CFA of a word )
  19.     [compile] '
  20. ;  immediate
  21.  
  22. \ Many FORTHS differ in the way that they implement -FIND
  23. \ ' CFA PFA etc.  These words are fairly unambiguous.
  24. \ The PFA is defined, in this case, as the address of data
  25. \ in a CREATE DOES> word.
  26. : PFA->NFA   ( pfa -- nfa  )
  27.     do-does-size - >name
  28. ;
  29.  
  30. : CFA->PFA  ( cfa -- pfa )
  31.     do-does-size +
  32. ;
  33.  
  34. : HO.FIND.PFA   ( -- , pfa flag , look for word in dict. )
  35. \ Return address of parameter data.
  36.      32 word find
  37.      IF  cfa->pfa true
  38.      ELSE drop false
  39.      THEN
  40. ;
  41. : HO.FIND.CFA   ( -- , cfa flag , look for word in dict. )
  42. \ Return address of identifying address
  43.      32 word find
  44.      IF true
  45.      ELSE drop false
  46.      THEN
  47. ;
  48.  
  49. .NEED c,
  50.   : C, ( byte -- , compile into dictionary )
  51.       dp @ c!   ( always use an even number of these!! )
  52.       1 dp +!
  53.   ;
  54. .THEN
  55.